package com.example.demo.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class YAML {
    @Value("${user.phone}")
    private String phone;
    @GetMapping("/phone")
    public String phone(){
        return "phone:"+phone;
    }


    @Value("${city[0]}")
    private String city;
    @GetMapping("/city")
    public String city(){
        return "city:"+city;
    }

    @Value("${books[0].name}")
    private String booksName;
    @GetMapping("/booksName")
    public String booksName(){
        return "booksName:"+booksName;
    }

    @Value("${books[0].city}")
    private String booksCity;
    @GetMapping("/booksCity")
    public String booksCity(){
        return "booksCity:"+booksCity;
    }
}
